/**
 * Created by Apple on 2017/7/26.
 */
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
module.exports = {
    entry: './js/entry.js',//入口文件
    output: {
        filename: './bundle.js',//出口
    },
    plugins: [
        new OpenBrowserPlugin({url: 'http://localhost:8080'})
    ],
    devServer: {
        port: 8080,
        inline: true,
    },
    resolve: {
        "extensions": ['.js', '.css', '.json'] //可以省略的扩展名
    },
    module: {
        loaders: [
            {test: /\.css$/, loader: 'style-loader!css-loader'},
            {
                test: /\.(gif|jpg|png|woff|svg|eot|ttf)$/,
                // loader: 'url-loader?limit=8192&name=images/[hash:8].[name].[ext]'
                loader: 'url-loader?limit=8192&name=images/[hash:8].[name].[ext]'
            }
            // {test: /\.png$/, loader: "file-loader?name=images/[hash:8].[name].[ext]"}
            /*          ,
             {
             test:/\.less$/,
             loader:'style-loader!css-loader!postcss-loader!less-loader'
             //postcss-loader的位置不能变
             }*/
        ]
    }
}